<?php
class model_newagk_basicrule extends gdl_components_basemodel 
{

    public function primarykey() {
        return 'id';
    }

    public function tableName() {
        return 'agk_basic_rule';
    }
	public function rule($basicid=0){
		if(!$basicid) return false;
		$ruleList = $this->getInfoArg(['basicid'=>$basicid]);
		$rules = [];
		foreach($ruleList as $v){
			$monitorRule = unserialize($v['monitorRule']);
			$monitorRule['rule'] = $v['rule'];
			$rules[] = $monitorRule;
		}
		
		return $rules;
	}
	 
	public function getInfoArg($arrg,$field='*')
    {
        return $this->select($arrg, $field)->items;
    }
	
}
